How commands work

When a user clicks a menu that contains a command, the following chain of events occurs:

1 Dreamweaver calls the canAcceptCommand() function, if defined, in each command file referenced in the menu to see whether this command is appropriate for the selection. If canAcceptCommand() returns FALSE, the command is dimmed in the menu.
2 The user selects a command from the menu.
3 Dreamweaver calls the receiveArguments() function, if defined, in the selected command file to give the command an opportunity to process any arguments passed from the dreamweaver.runCommand() function.
4 Dreamweaver calls the commandButtons() function, if defined, to determine which buttons appear along the right side of the options dialog box and what code should be executed when the user clicks the buttons.
5 Dreamweaver scans the command file for a FORM tag. If a form exists, Dreamweaver calls the windowDimensions() function to determine the size of the options dialog box containing the BODY elements of the file. If windowDimensions() is not defined, the size of the dialog box is determined automatically.
6 If the command file's BODY tag contains an onLoad handler, Dreamweaver executes it (regardless of whether a dialog box is displayed). If no dialog box appears, the remaining steps do not occur.
7 The user selects options for the command. Dreamweaver executes event handlers associated with the fields as the user encounters them.
8 The user clicks one of the buttons defined by commandButtons().
9 Dreamweaver executes the code associated with the button that was clicked.
10 The dialog box remains visible until one of the scripts in the command calls window.close().